package com.yc.spring.vote.biz;

import com.yc.spring.vote.dao.VoteDao;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service("abc")
@Data
public class VoteBiz {

    @Autowired
    @Qualifier("vDao")
    VoteDao voteDao;

    public void login(String user, String name){
        System.out.println("=======login======");
        Object o = null;
        System.out.println(o.toString());
    }

    public void register(String user, String name){
        System.out.println("=======register======");
        int i = 1/0;
    }

    public int add( int a, int b) throws InterruptedException {
        Thread.sleep(new Random().nextInt(1000));
        return a + b;
    }

}
